<?php
declare (strict_types = 1);

namespace app\admin\controller;
use app\BaseController;
use app\middleware\admin\Auth;
use think\facade\Db;

class About extends BaseController
{
    protected $middleware=[Auth::class];
    public function index()
    {

        return $this->success(Db::table('about')->order('id','desc')->paginate(10));
    }


    public function create()
    {

        return $this->success(Db::table('about')->insert(request()->param()));
    }


    public function update($id)
    {

        return $this->success(Db::table('about')->where('id',$id)->update(request()->param()));
    }


    public function delete($id)
    {
        return $this->success(Db::table('about')->where('id',$id)->delete());
    }

}
